<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 最简化的sleep函数
        const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
        sleep(3000).then(()=>{
            console.log(`3秒后输出`);
        });
    </script>
</body>
</html>